package main

import (
	"context"
	"github.com/apenella/go-ansible/pkg/adhoc"
	"github.com/apenella/go-ansible/pkg/options"
)

func main() {
	ansibleConnections := &options.AnsibleConnectionOptions{
		AskPass:       false,
		Connection:    "local",
		PrivateKey:    "",
		SCPExtraArgs:  "",
		SFTPExtraArgs: "",
		SSHCommonArgs: "",
		SSHExtraArgs:  "",
		Timeout:       0,
		User:          "",
	}

	ansibleAdhocOptions := &adhoc.AnsibleAdhocOptions{
		Args:              "ping 127.0.0.1 -c 2",
		AskVaultPassword:  false,
		Background:        0,
		Check:             false,
		Diff:              false,
		ExtraVars:         nil,
		ExtraVarsFile:     nil,
		Forks:             "",
		Inventory:         " 127.0.0.1,",
		Limit:             "",
		ListHosts:         false,
		ModuleName:        "command",
		ModulePath:        "",
		OneLine:           false,
		PlaybookDir:       "",
		Poll:              0,
		SyntaxCheck:       false,
		Tree:              "",
		VaultID:           "",
		VaultPasswordFile: "",
		Verbose:           false,
		Version:           false,
	}

	adhoc := &adhoc.AnsibleAdhocCmd{
		Binary:                     "",
		Exec:                       nil,
		Pattern:                    "all",
		Options:                    ansibleAdhocOptions,
		ConnectionOptions:          ansibleConnections,
		PrivilegeEscalationOptions: nil,
		StdoutCallback:             "",
	}

	err := adhoc.Run(context.TODO())
	if err != nil {
		panic(err)
	}
}
